package main

import (
	"fmt"
	"ocr/pkg/ocr"

	"github.com/gin-gonic/gin"
)

func main() {
	r := ocr.Create()
	r.Use(ocr.OcrHandler{Exclude: []string{}, Handler: demo3})
	nr := r.Group("/v1")
	{
		nr.Use(
			ocr.OcrHandler{Exclude: []string{"/demo"}, Handler: demo1},
			ocr.OcrHandler{Exclude: []string{}, Handler: demo2},
		)
		nr.GET("/demo", func(c *gin.Context) {
			c.String(200, "hhh")
		})
	}
	r.Listen(3003)
}

func demo1(c *gin.Context) {
	fmt.Println("demo1")
	c.Next()
}

func demo2(c *gin.Context) {
	fmt.Println("demo2")
}

func demo3(c *gin.Context) {
	fmt.Println("demo3")
}

func demo4(c *gin.Context) {
	fmt.Println("demo4")
}
